package com.example.seckillconsumer.config;

import feign.RequestInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author likaiping
 * @createTime 2024/7/3 14:26
 */
@Configuration
public class FeignConfig {
    private String GATEWAY_TOKEN = "gateway-token";
    private String GATEWAY_TOKEN_VALUE = "this-is-gateway-request";
    @Bean
    public RequestInterceptor requestInterceptor() {
        return requestTemplate ->
                requestTemplate.header(GATEWAY_TOKEN, GATEWAY_TOKEN_VALUE);
    }
}
